/**
\author Zachary Wartell - Copyright 2007.  All rights reserved.
\brief OpenGLTrainer.h defines a variety of functions for early ITCS4120 projects.
*/
#ifndef OPENGL_TRAINER_H
#define OPENGL_TRAINER_H

/*******************************************************************************
    INCLUDES
*******************************************************************************/
#ifdef WIN32
#include <windows.h>
#endif

//#include <OpenGLTrainer/OpenGLTrainer_exports.h>

/*******************************************************************************
    MACROS
*******************************************************************************/
// NONE

/*******************************************************************************
    DATA TYPES
*******************************************************************************/
/**
\brief ITCS4120 includes all declarations in OpenGLTrainer
*/
namespace ITCS4120
{

/**
\brief OpenGLTrainer includes all declarations in OpenGLTrainer
*/
namespace OpenGLTrainer
{


/**
\brief High-resolution timer.  Works similar to traditional stop watch.

\internal Consider bringing in Boost library Timer
*/
class Timer
    {
    public:
    /** 
    \brief Seconds measurement
    */
    typedef double Seconds;
    Timer();
    void lap();
    
    /**
    \brief return the interval (elapsed time) of last lap 
    */    
    inline Seconds lastLapInterval() const {return lastLapInterval_;}

    /**
    \brief reset timer to 0
    */
    void reset();

    /**
    \brief return time since timer was started or reset
    */
    Seconds elapsed() const;
    private:	    
   #ifdef _WIN32
    typedef LARGE_INTEGER Win32TimeInteger;
    Win32TimeInteger lastLap_;
    Win32TimeInteger start_;
    Seconds lastLapInterval_;
    static Win32TimeInteger frequency;
   #else
    clock_t lastLap_;
    Second lastLapInterval_;
   #endif
    };

/******************************************************************************
    EXPORTED FUNCTIONS
******************************************************************************/
/* NONE */
/******************************************************************************
    EXPORTED GLOBALS
******************************************************************************/
// NONE
};
};
#endif